<?php

namespace app\admin\validate\law_case;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class Trade
 * @package app\admin\validate\law_case
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 */
class Trade extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id'	=> 'isId',
		'payMethod'	=> 'scalar|max:16',
		'orderNo'	=> 'scalar|max:64',
		'tradeNid'	=> 'scalar|max:50',
		'describe'	=> 'scalar|max:255',
		'tradeTypeClass'	=> 'scalar|max:255',
		'consultingId'	=> 'integer|max:11',
		'serverId'	=> 'integer|max:11',
		'redPacketId'	=> 'integer|max:11',
		'rewardId'	=> 'integer|max:11',
		'lawCaseId'	=> 'integer|egt:0|max:11',
		'totalMoney'	=> 'numeric|egt:0',
		'payMoney'	=> 'numeric|egt:0',
		'memberId'	=> 'integer|max:11',
		'payStatus'	=> 'scalar|max:16',
		'payTime'	=> 'likeId',
		'refundStatus'	=> 'scalar|max:16',
		'attach'	=> 'scalar',
		'created'	=> 'integer|max:11',
		'updated'	=> 'integer|max:11',
        'page'      => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id'	=> 'id',
		'payMethod'	=> 'payMethod',
		'orderNo'	=> 'orderNo',
		'tradeNid'	=> 'tradeNid',
		'describe'	=> 'describe',
		'tradeTypeClass'	=> 'tradeTypeClass',
		'consultingId'	=> 'consultingId',
		'serverId'	=> 'serverId',
		'redPacketId'	=> 'redPacketId',
		'rewardId'	=> 'rewardId',
		'lawCaseId'	=> 'lawCaseId',
		'totalMoney'	=> 'totalMoney',
		'payMoney'	=> 'payMoney',
		'memberId'	=> 'memberId',
		'payStatus'	=> 'payStatus',
		'payTime'	=> 'payTime',
		'refundStatus'	=> 'refundStatus',
		'attach'	=> 'attach',
		'created'	=> 'created',
		'updated'	=> 'updated',
        'page'      => '分页页数',
        'page_size' => '分页大小',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require'	=> '缺少:attribute',
		'id.isId'	=> '请设置正确的:attribute',
		'payMethod.require'	=> '请输入:attribute',
		'payMethod.scalar' => ':attribute应该是字符串',
		'payMethod.max'	=> ':attribute长度不能超过:rule位',
		'orderNo.require'	=> '请输入:attribute',
		'orderNo.scalar' => ':attribute应该是字符串',
		'orderNo.max'	=> ':attribute长度不能超过:rule位',
		'tradeNid.require'	=> '请输入:attribute',
		'tradeNid.scalar' => ':attribute应该是字符串',
		'tradeNid.max'	=> ':attribute长度不能超过:rule位',
		'describe.require'	=> '请输入:attribute',
		'describe.scalar' => ':attribute应该是字符串',
		'describe.max'	=> ':attribute长度不能超过:rule位',
		'tradeTypeClass.require'	=> '请输入:attribute',
		'tradeTypeClass.scalar' => ':attribute应该是字符串',
		'tradeTypeClass.max'	=> ':attribute长度不能超过:rule位',
		'consultingId.require'	=> '请输入:attribute',
		'consultingId.integer' => ':attribute应该是整数',
		'consultingId.max'	=> ':attribute长度不能超过:rule位',
		'serverId.require'	=> '请输入:attribute',
		'serverId.integer' => ':attribute应该是整数',
		'serverId.max'	=> ':attribute长度不能超过:rule位',
		'redPacketId.require'	=> '请输入:attribute',
		'redPacketId.integer' => ':attribute应该是整数',
		'redPacketId.max'	=> ':attribute长度不能超过:rule位',
		'rewardId.require'	=> '请输入:attribute',
		'rewardId.integer' => ':attribute应该是整数',
		'rewardId.max'	=> ':attribute长度不能超过:rule位',
		'lawCaseId.require'	=> '请输入:attribute',
		'lawCaseId.integer' => ':attribute应该是整数',
		'lawCaseId.egt'	=> ':attribute应该大于等于:rule',
		'lawCaseId.max'	=> ':attribute长度不能超过:rule位',
		'totalMoney.require'	=> '请输入:attribute',
		'totalMoney.numeric' => ':attribute应该是数字',
		'totalMoney.egt'	=> ':attribute应该大于等于:rule',
		'payMoney.require'	=> '请输入:attribute',
		'payMoney.numeric' => ':attribute应该是数字',
		'payMoney.egt'	=> ':attribute应该大于等于:rule',
		'memberId.require'	=> '请输入:attribute',
		'memberId.integer' => ':attribute应该是整数',
		'memberId.max'	=> ':attribute长度不能超过:rule位',
		'payStatus.require'	=> '请输入:attribute',
		'payStatus.scalar' => ':attribute应该是字符串',
		'payStatus.max'	=> ':attribute长度不能超过:rule位',
		'payTime.require'	=> '请选择:attribute',
		'payTime.isId'	=> '请选择正确的:attribute',
		'refundStatus.require'	=> '请输入:attribute',
		'refundStatus.scalar' => ':attribute应该是字符串',
		'refundStatus.max'	=> ':attribute长度不能超过:rule位',
		'attach.require'	=> '请输入:attribute',
		'attach.scalar' => ':attribute应该是字符串',
		'created.require'	=> '请输入:attribute',
		'created.integer' => ':attribute应该是整数',
		'created.max'	=> ':attribute长度不能超过:rule位',
		'updated.require'	=> '请输入:attribute',
		'updated.integer' => ':attribute应该是整数',
		'updated.max'	=> ':attribute长度不能超过:rule位',
        'page.require'      => '请输入:attribute',
        'page.integer'      => ':attribute应该是整数',
        'page.egt'          => ':attribute应该大于等于:rule',
        'page.max'          => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt'     => ':attribute应该大于等于:rule',
        'page_size.max'     => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index'  => ['page', 'page_size'],
        'read'   => ['id' => 'require'],
        'save'   => ['payMethod', 'orderNo', 'tradeNid', 'describe', 'tradeTypeClass', 'consultingId', 'serverId', 'redPacketId', 'rewardId', 'lawCaseId', 'totalMoney', 'payMoney', 'memberId', 'payStatus', 'payTime', 'refundStatus', 'attach', 'created', 'updated'],
    ];

}
